import Layout from "@/layout";

const routes = [
  {
    path: "/login",
    component: () => import("@/views/login/index"),
    hidden: true,
  },

  {
    path: "/404",
    component: () => import("@/views/404"),
    hidden: true,
  },

  {
    path: "/",
    component: Layout,
    redirect: "/dashboard",
    children: [
      {
        path: "dashboard",
        name: "Dashboard",
        component: () => import("@/views/dashboard/index"),
        meta: { title: "首页", icon: "el-icon-s-grid" },
      },
    ],
  },

  {
    path: "/banner",
    component: Layout,
    children: [
      {
        path: "index",
        component: () => import("@/views/banner/index"),
        meta: { title: "轮播图管理", icon: "el-icon-money" },
      },
    ],
  },
  {
    path: "/notice",
    component: Layout,
    children: [
      {
        path: "index",
        component: () => import("@/views/notice/index"),
        meta: { title: "公告管理", icon: "el-icon-bell" },
      },
    ],
  },
  {
    path: "/user",
    component: Layout,
    children: [
      {
        path: "index",
        component: () => import("@/views/user/index"),
        meta: { title: "用户管理", icon: "el-icon-user" },
      },
    ],
  },
  {
    path: "/tabs",
    component: Layout,
    children: [
      {
        path: "index",
        component: () => import("@/views/tabs/index"),
        meta: { title: "标签管理", icon: "el-icon-set-up" },
      },
    ],
  },
  {
    path: "/message",
    component: Layout,
    redirect: "/message/index",
    name: "Message",
    meta: { title: "消息管理", icon: "el-icon-chat-dot-round" },
    children: [
      {
        path: "index",
        component: () => import("@/views/message/index.vue"),
        meta: { title: "留言", icon: "el-icon-message" },
      },
      {
        path: "information",
        component: () => import("@/views/message/information/index.vue"),
        meta: { title: "资讯", icon: "el-icon-chat-line-square" },
      },
      {
        path: "collect",
        component: () => import("@/views/message/collect/index.vue"),
        meta: { title: "收藏", icon: "el-icon-chat-line-round" },
      },
      {
        path: "comment",
        component: () => import("@/views/message/comment/index.vue"),
        meta: { title: "评论", icon: "el-icon-chat-dot-square" },
      },
    ],
  },
  {
    path: "/category",
    component: Layout,
    children: [
      {
        path: "index",
        component: () => import("@/views/category/index.vue"),
        meta: { title: "分类管理", icon: "tree" },
      },
    ],
  },

  {
    path: "external-link",
    component: Layout,
    children: [
      {
        path: "https://panjiachen.github.io/vue-element-admin-site/#/",
        meta: { title: "External Link", icon: "link" },
      },
    ],
  },

  { path: "*", redirect: "/404", hidden: true },
];

export default routes;